<?php
//检测是否被设置并且不为null
if(isset($_SESSION['success']))
{?>

    <div class="alert alert-success alert-dismissible" id='hideMe'>
        <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
        <h4><i class="icon fa fa-check"></i> 成功!</h4>
        <?php echo $_SESSION['success'];?>
    </div>

<?php
//释放变量
    unset($_SESSION['success']);
}

if(isset($_SESSION['error']))
{?>

    <div class="alert alert-danger alert-dismissible">
        <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
        <h4><i class="icon fa fa-ban"></i> 错误!</h4>
        <?php echo $_SESSION['error'];?>
    </div>

<?php
unset($_SESSION['error']);
}
?>




